import java.util.Arrays;
import java.util.Scanner;

public class Text1 {
    public static int getValue(int[] gifts, int n) {
        Arrays.sort(gifts);
        int ret = 0;
        for (int i = 0; i < gifts.length; i++) {
            if (gifts[i]==gifts[n/2]){
                ret++;
            }
        }
        if (ret<=n/2){
            return 0;
        }
        return gifts[n/2];
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = 5 ;
        int[] gifts = {1,2,2,3,2};
        int ret = getValue(gifts,n);
        System.out.println(ret);
    }
}
